package jmine.tec.hydra.web;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author katsuo.ogawa
 * @date Aug 3, 2011
 */
public enum HydraWebMessages implements MessageCreator {

    ERRO_HYDRA_SPECIFICATION_JA_ATIVADA(2, "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.specification.ja.ativada"),

    ERRO_HYDRA_SPECIFICATION_JA_DESATIVADA(2,
            "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.specification.ja.desativada"),

    INFO_HYDRA_SPECIFICATION_ATIVADA_SUCESSO(2,
            "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.specification.ativada.sucesso"),

    INFO_HYDRA_SPECIFICATION_DESATIVADA_SUCESSO(2,
            "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.specification.desativada.sucesso"),

    ERRO_SCHEDULED_SPECIFICATION_PREENCHER_DATA(2,
            "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.scheduled.specification.preencher.data"),

    ERRO_SCHEDULED_SPECIFICATION_SEM_REQUESTS(0,
            "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.scheduled.specification.sem.requests"),

    INFO_SCHEDULED_SPECIFICATION_EXECUTADA_SUCESSO(3,
            "jmine.tec.hydra.web.pages.consulta.integracao.especificacao.hydra.scheduled.specification.executada.sucesso"),

    SELECT_AT_LEAST_ONE_RECORD(0, "jmine.tec.hydra.web.pages.envio.arquivos.selecione.pelo.menos.um.registro"),

    SELECT_SPECIFICATION(0, "jmine.tec.hydra.web.pages.envio.arquivos.selectione.especificacao"),

    SPECIFICATION_FOR_THE_SYSTEM_NOT_FOUND(2, "jmine.tec.hydra.web.pages.envio.arquivos.especificacao.nao.encontrada.para.sistema"),

    SEND(0, "jmine.tec.hydra.web.pages.send");

    public static final String DEFAULT_BUNDLE = "jmine-tec-web-hydra-messages";

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private HydraWebMessages(int nargs, String key) {
        this(DEFAULT_BUNDLE, key, nargs);
    }

    /**
     * Construtor
     * 
     * @param bundle bundle
     * @param key key
     * @param nargs nargs
     */
    private HydraWebMessages(String bundle, String key, int nargs) {
        this.delegate = MessageCreatorHelper.creator(bundle, key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
